// 运动圈
import ajax from '@/libs/ajax'
import ajaxImg from '@/libs/ajaxImg'
/**
 * 运动圈
 * @param {*} data 数据
 */
const API_GET_NEW_TOPICS = (data) => ajax('/pub/topics/getNewTopics', 'get', data)

// 获取详情
const API_GET_TOPICS_DETAILS = (id) => ajax('/pub/topics/getTopicsDetails/' + id, 'get', {})

// 评论

const API_ADD_COMMENTS = (data) => ajax('/v1/OperateTopics/addComments', 'post', data)

// 获取评论列表

const API_GET_TOPIC_COMMENTS = (data) => ajax('/pub/topics/getTopicComments', 'get', data)

// 点赞

const API_ADD_THUMBS_UP = (data) => ajax('/v1/OperateTopics/addThumbsUp?userId=' + data.userId + '&contentId=' + data.contentId + '&type=' + data.type, 'post', data)

// 发布运动圈

const API_ADD_TOPICS = (userID, data) => ajax('/v1/OperateTopics/addTopics/' + userID, 'post', data)

// 发布运动圈图片

const API_UPLOAD_TOPICS_IMAGE = (data) => ajaxImg('/v1/OperateTopics/uploadTopicsImage?topicId=' + data.topicId, data.imgFile, {}, 'post')

export { API_GET_NEW_TOPICS, API_GET_TOPICS_DETAILS, API_GET_TOPIC_COMMENTS, API_ADD_THUMBS_UP, API_ADD_TOPICS, API_UPLOAD_TOPICS_IMAGE, API_ADD_COMMENTS }
